package com.xiaow.android.ebook.app.adapter;

import java.util.List;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class ImageAdapter extends BaseAdapter {

	private List<View> list;

	public ImageAdapter(List<View> list) {
	    this.list = list;
	}

	
	public int getCount() {
		return list.size();
	}

	
	public Object getItem(int position) {
		return position;
	}

	
	public long getItemId(int position) {
		return position;
	}

	
	public View getView(int position, View convertView, ViewGroup parent) {
	    if(convertView==null)
	        return list.get(position);
		return convertView;
	}
	
	public void changeData(List<View> list){
	    this.list = list;
	    this.notifyDataSetChanged();
	}
	
	public void addView(View view){
	    list.add(view);
	    this.notifyDataSetChanged();
	}
	
}
